home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / 422mods.zip / RATMAN04.422 < prev    next >
Text File  |  1993-04-04  |  11KB  |  331 lines

  1. RATMAN04.MOD - CBV designed for 4.22
  2. Rat Man #1 @6255
  3. Tue Mar 30 21:04:45 1993
  4. ┌────────────────────────────────────────────────────────────────────────────┐
  5. │ Mod Name: RATMAN04.MOD                  Mod Author: RAT MAN 1@6255 ICEnet  │
  6. │ Difficulty: Bah, humbug                 Date: 03/28/93                     │
  7. │ WWIV Version: 4.22                                                         │
  8. │ Description: BBS will call new user back for auto validation provided they │
  9. │              are within a SysOp defined calling range.                     │
  10. └────────────────────────────────────────────────────────────────────────────┘
  11.  
  12. DISCLAIMER: I didn't do it, nobody saw me do it, you can't prove anything!
  13.  
  14.    This MOD was originally made by Goose. In turn, Ed O'Brien fixed it to work
  15. with WWIV 4.20. Then, I modified it to take advantage of the new features in
  16. WWIV 4.22, such as the data phone number, and added a few extras (Such as the
  17. optional step 5). If you do not want the BBS to call the data phone number or
  18. you don't have the extended user info enabled, you have two options. You can
  19. enable the extended user info (In the second case only) or you can fix it
  20. yourself. Just change all occurrences of thisuser.dataphone to thisuser.phone.
  21. Then change the text to fit the change appropriately. 60% of the credit goes
  22. to Goose, 10% to Ed O'Brien, and 30% to me for this MOD. This will also
  23. partially cover the new ESM standard.
  24.  
  25. Of course, use the generic legend:
  26.  
  27. + Add line
  28. % Existing line
  29.  
  30. -- QUOTE FROM GOOSE --
  31.    This mod is based on one seen on WWIVnet by Carpenter that did something
  32. very similar, but I think this one is a little more flexible as the sysop can
  33. define the area codes and phone prefixes that are allowed to have callback
  34. validation.  In metro areas like DC a call to another area code can be local,
  35. while in most places there are calls inside your area code that are charged as
  36. long distance.
  37.  
  38. NOTE:  One thing this mod assumes is that even if the area code is different,
  39.        that there is no need to dial it as a prefix since the number is local.
  40.        This is the way the DC area works, but I'm not sure about some others.
  41. ------ END QUOTE -----
  42.  
  43. STEP 1: LOAD UP NEWUSER.C.
  44.  
  45. Read this code in just before void newuser():
  46.  
  47. void check_auto_validate()                  /* mod - add entire void */
  48. {
  49.   int ok,f,i;
  50.   char s[161],s1[81];
  51.   long p,l;
  52.  
  53.   ok=0;
  54.   strncpy(s1,thisuser.dataphone,7);
  55.   s1[7]=0;
  56.   strcpy(s,syscfg.gfilesdir);
  57.   strcat(s,"CALLBACK.TXT");
  58.   f=open(s,O_RDWR | O_BINARY);
  59.   if (f<0)
  60.     return;
  61.   lseek(f,0L,SEEK_SET);
  62.   l=filelength(f);
  63.   p=0;
  64.   while ((p<l) && (!ok)) {
  65.     lseek(f,p,SEEK_SET);
  66.     read(f,(void *)s,150);
  67.     i=0;
  68.     while ((i<150) && (s[i])) {
  69.       if (s[i]==13)
  70.     s[i]=0;
  71.       else
  72.     ++i;
  73.     }
  74.     s[150]=0;
  75.     p += (long) (i+2);
  76.     if (s[i-1]==1)
  77.       s[i-1]=0;
  78.     if (!strncmp(s1,s,7))
  79.       ok=1;
  80.   }
  81.   close(f);
  82.   if (ok) {
  83.     printfile("CALLBACK");
  84.     prt(5,"Do you want to do this? ");
  85.     if (yn()) {
  86.        nl();
  87.        pl("The system will now hang up and attempt to call.  Please be prepared to have");
  88.        pl("your modem answer the phone.");
  89.        delay(3000);
  90.        dtr(0);
  91.        wait1(9);
  92.        dtr(1);
  93.        for (i=0; i<8; i++) {
  94.       s1[i]=thisuser.dataphone[i+4];
  95.        }
  96.        s1[8]=0;
  97.        sprintf(s,"Attempting Callback Validation to %s.",s1);
  98.        outs(s);
  99.        sprintf(s,"~~~~~ATDT%s{",s1);
  100.        pr2(s);
  101.        ok=1;
  102.        i=0;
  103.        do {
  104.      if (!cdet()) wait1(100);
  105.        } while ((!cdet()) && (i++<6));
  106.        if ((cdet()) && (!hangup)) {
  107.      i=0;
  108.      do { } while (inkey()!=0);
  109.      do {
  110.        ok=0;
  111.        nl();
  112.        pl("Enter your password.");
  113.        pl(get_string(357));
  114.        input(s,8);
  115.        if (!strcmp(s,thisuser.pw))
  116.          ok=1;
  117.      } while ((!ok) && (!hangup) && (i++<4));
  118.        } else
  119.      ok=0;
  120.        if (ok) {
  121.      nl();
  122.      pl("Callback validation completed.  Your account has been upgraded.");
  123.      sysoplog("### User validated by CALLBACK validation");
  124.          thisuser.sl=35;             /* change these to whatever you give */
  125.          thisuser.dsl=35;            /* to validated new users            */
  126.          thisuser.restrict=24;       /* restricts * & A           */
  127.          thisuser.ar=1;              /* AR of A                   */
  128.          thisuser.dar=1;             /* DAR of A                  */
  129.      actsl=thisuser.sl;          /* changed to WWIV 4.20+ format      */
  130.      pausescr();
  131.        } else {
  132.      nl();
  133.      pl("Callback validation failed.  Deleting your account.");
  134.      sysoplog("### User failed CALLBACK validation.");
  135.      deluser(usernum); /* Remove this if you don't want a user that */
  136.                /* failed the CBV to be deleted.             */
  137.      delay(3000);
  138.      dtr(0);
  139.      hangup=1;
  140.        }
  141.     } else {
  142.        nl();
  143.        pl("Callback validation skipped.  You will have to wait for the sysop to");        
  144.        pl("validate your account.");
  145.        sysoplog("### User did not want CALLBACK validation.");
  146.        pausescr();
  147.     }
  148.   }
  149. }
  150.  
  151. STEP 2: STILL IN NEWUSER.C
  152.  
  153.    At the bottom of this file, at the very end of void newuser(), make the
  154. following additions and changes:
  155.  
  156. %     if (syscfg.newuser_c[0]) {
  157. %       stuff_in(s,syscfg.newuser_c,create_chain_file("CHAIN.TXT"),"","","","");
  158. %       full_external(s,0,1);
  159. %     }
  160. +     if (incom) check_auto_validate();                       /* mod - add */
  161. %   }
  162. % }
  163.  
  164. STEP 3: LOAD UP BBS.C
  165.  
  166. Make the following changes:
  167.  
  168. %  if ((strcmp(s,"UPLOAD")==0) && (actsl>10))
  169. %    upload_post();
  170. +  if (strcmp(s,"VALIDATE")==0) check_auto_validate();
  171. %  if (strcmp(s,"QSCAN")==0) {
  172. %    nl();
  173. %    prt(5,get_string(24));
  174.  
  175. STEP 4: LOAD UP MODEM.C
  176.  
  177. Insert the following function after void pr1(unsigned char *s):
  178.  
  179. void pr2(unsigned char *s)
  180. {
  181.   int i;
  182.  
  183.   for (i = 0; s[i] > 0; i++) {
  184.     if (s[i] == 123)                          /* Checks for {                 */
  185.       outcomch(13);                           /* Outputs RETURN if { is found */
  186.     else if ((s[i] == 255) || (s[i] == 126))  /* Checks for ASCII 255 or ~    */
  187.       wait1(9);                               /* Waits if either is found     */
  188.     else                                      /* But if neither are found     */
  189.       outcomch(s[i]);                         /* Just output the character    */
  190.   }
  191. }
  192.  
  193. STEP 5: (OPTIONAL) LOAD UP LILO.C
  194.  
  195.    Install this step if you want all unvalidated users to be offered the CBV
  196. every time you log on. This is perfect for having all your current users go
  197. through the CBV. Just simply lower their SL to unvalidated status and they
  198. will be offered to use the CBV.
  199.  
  200. NOTE: Change the number 50 in (thisuser.sl<50) to any number greater than your
  201. unvalidated user SL. For instance, if any user with an SL less than 50 was
  202. considered unvalidated, then 50 would go there. Any user with an SL less than
  203. that number will be offered the use of the CBV.
  204.  
  205. % void logon(void)
  206. % {
  207. %   char s[255],s1[181],s2[81],*ss;
  208. %   int i,i1,f;
  209. %   long len,pos;
  210. %
  211. %   if (usernum<1) {
  212. %     hangup=1;
  213. %     return;
  214. %   }
  215. %
  216. %   if (live_user) {
  217. %     reset_colors();
  218. %     ansic(0);
  219. %     outchr(12);
  220. +     if (thisuser.sl<50) check_auto_validate(); /* RATMAN04.MOD */
  221. %   }
  222. %   if (incom && live_user) {
  223. %     i=printfile("LOGON");
  224. %     if ((!i) && (!(thisuser.sysstatus & sysstatus_pause_on_page)))
  225. %       pausescr();
  226. %   }
  227.  
  228. STEP 6: TYPE MAKE FCNS OR LOAD UP FCNS.H
  229.  
  230.    If you use the MAKE FCNS way you can skip the rest of this step.
  231.  
  232. % /* File: newuser.c */
  233. %
  234. % int check_name(char *nn);
  235. % void input_name(void);
  236. % void input_realname(void);
  237. % void input_callsign(void);
  238. % int valid_phone(char *phone);
  239. % void input_phone(void);
  240. % void input_street(void);
  241. % void input_city(void);
  242. % void input_state(void);
  243. % void input_country(void);
  244. % void input_zipcode(void);
  245. % void input_dataphone(void);
  246. % void input_sex(void);
  247. % void input_age(userrec *u);
  248. % void input_comptype(void);
  249. % void input_screensize(void);
  250. % void input_pw(void);
  251. % void input_ansistat(void);
  252. + void check_auto_validate();           /* RATMAN04.MOD */
  253. % void newuser(void);
  254.  
  255. Still in FCNS.H, change this too:
  256.  
  257. /* File: modem.c */
  258.  
  259. % void pr1(unsigned char *s);
  260. + void pr2(unsigned char *s);           /* RATMAN04.MOD */
  261. % void get_modem_line(char *s, double d, int allowa);
  262. % void do_result(result_info *ri);
  263. % void process_full_result(char *s);
  264. % int mode_switch(double d, int allowa);
  265. % void holdphone(int d);
  266. % void imodem(int x);
  267. % void answer_phone(void);
  268.  
  269. That's it for the source mods.  You'll need to recompile the entire BBS
  270. because of the changes to FCNS.H.  When that's complete, you'll need to create
  271. two files to put into your GFILES directory.  The first is CALLBACK.TXT, and
  272. should include a one line entry for each valid area code/dialing prefix
  273. combination in your local area.  These should be listed in the front of the
  274. phone book.  For example, for St. Paul, Minnesota and the rest of the twin
  275. cities metro area, the following entries are valid (This is a partial list,
  276. the whole list is WAY too big, so don't use this!):
  277.  
  278. 612-220
  279. 612-221
  280. 612-222
  281. 612-223
  282. 612-224
  283. 612-225
  284. 612-227
  285. 612-228
  286. 612-229
  287. 612-232
  288. 612-244
  289. 612-266
  290. 612-282
  291. 612-290
  292. 612-291
  293. 612-292
  294.  
  295. Finally, you'll need to create a file called CALLBACK.MSG.  This describes to
  296. the user what is required from them if they want to be validated using
  297. callback.  Mine is as follows:
  298.  
  299. (NOTE: Typos have been fixed and some color added, as well as some rewording)
  300.  
  301. ******************************************************************************
  302.  
  303. 1   It has been determined that your data phone number is within the local
  304. 1calling area. As of now you are unvalidated. You may use a call back system
  305. 1installed on this BBS to increase your access.
  306.  
  307. 1   To do this, tell your modem to answer the phone by issuing the command
  308. 1"ATA" (without the quotes) once the phone starts ringing.  Note that if you
  309. 1have a non-Hayes compatible modem, this command will be different.   Do not
  310. 1answer the phone voice, or the modem will hang up.
  311.  
  312. 1   You will then be asked for your password.  If you fail to enter the
  313. 1password correctly, or if no connection is made on callback, your account
  314. 1will be deleted and you will have to re-register.
  315.  
  316. 1   If you do not wish to do this, or you are at a different number than that
  317. 1shown in your account, please call back later when you are at the number you
  318. 1gave. If you are unable to use this system, please leave feedback to the
  319. 1SysOp explaining your problem and you will be validated manually.
  320.  
  321. ******************************************************************************
  322.  
  323. That's it.  Now your new callers won't have to wait so long before being
  324. validated, and you'll have the satisfaction of knowing that the number that
  325. they gave in their logon is valid (and have a reason to be cautious if they
  326. decided to skip the validation).
  327.  
  328.    Note: If the users want to get validated later they can type //VALIDATE at
  329. the main menu. If they use //VALIDATE and nothing happens, then their phone
  330. prefix is not in your CALLBACK.TXT.
  331.